package com.jf.spring.dao;

import com.jf.spring.bean.Student;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

/**
 * Created with IntelliJ IDEA
 * Description:
 * User:22954
 * Date:2024-10-27
 * Time:0:09
 */
@Repository
public class StudentDAO {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    public int insertStudent(Student student) {
        String sql = "insert into student values(?,?,?)";
        int update = jdbcTemplate.update(sql, student.getId(), student.getName(), student.getAge());
        return update;
    }
}
